package edu.ccut.saturn.manager.logger.core;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import edu.ccut.saturn.component.DefaultComponent;
import edu.ccut.saturn.component.IParameterContext;
import edu.ccut.saturn.component.SaturnLoggerManager;

public class QueryAllLoggerLevel extends DefaultComponent {
	@Override
	public void execute(IParameterContext parameterContext) throws Exception {
		
        List<Map<String, String>> allLevels = new ArrayList<Map<String, String>>();
		
		for (String level : SaturnLoggerManager.getInstance().getAllLevel()) {
			
			Map<String, String> maps = new HashMap<String, String>();
			maps.put("key", level);
			maps.put("value", level);
		
			allLevels.add(maps);
		}
		
		parameterContext.setParameter(0, allLevels);
	}
}